﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ReNameEx.Model
{
    public class InsertRule : ReExRuleBase
    {
        public override string GetDesc()
        {
            return $"在位置 {InsertIndex} 插入文本 {InsertText}"; ;
        }

        public override void PrewRule(IEnumerable<ReExFile> files)
        {
            if (Enable)
            {
                foreach (ReExFile file in files)
                {
                    if (file.IsApply)
                    {
                        file.NewFileName = file.NewFileName.Insert(InsertIndex, InsertText);
                    }
                }
            }
        }
        public int InsertIndex { get; set; }
        public string InsertText { get; set; } = string.Empty;
    }
}
